import React from "react";
import { Tag, Icon } from "antd";

class ApiEdit extends React.Component {
	render() {
		const { data, removeApi, openListModal, urlPrefix } = this.props;
		return (
			<div>
				<div>
					触发知识点时调用接口:
					<Tag
						closable={!urlPrefix}
						onClose={removeApi}
						style={{ margin: "0px 10px" }}>
						{data.name}
					</Tag>
					{urlPrefix ? null : (
						<Icon type='edit' onClick={() => openListModal("api")} />
					)}
				</div>
			</div>
		);
	}
}

export default ApiEdit;
